package com.smartstate.dataManagement.service;

import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONArray;
import com.smartstate.dataManagement.dto.EnergyDTO;
import com.smartstate.dataManagement.dto.ObjMoudelDTO;
import com.smartstate.dataManagement.dto.common.TreeNode;
import com.smartstate.dataManagement.entity.ObjMoudel;
import com.smartstate.dataManagement.vo.ObjMoudelNameVo;
import com.smartstate.dataManagement.vo.ObjMoudelTwoVo;
import com.smartstate.dataManagement.vo.ObjmiddleVo;
import org.apache.ibatis.annotations.Param;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.multipart.MultipartFile;

import java.util.List;
import java.util.Map;

public interface ObjMoudelService extends ServiceBase<ObjMoudel>{

    /**
     * 楼宇树结构
     * @return
     */
    List<TreeNode> selectMoudel(String type);


    /**
     * 能源消耗分析 循环查
     * @param item
     * @return
     */
    List<Map<String, String>> selectMetering(@Param("item") EnergyDTO item);


    /**
     * 能源消耗分析 循环查
     * @param item
     * @return
     */
    Map<String,Object> selectPowerTree(@Param("item") EnergyDTO item);


    /**
     * 添加设备 和楼宇 中间表
     * @param objmiddleVo
     */
    int addObjmiddle(ObjmiddleVo objmiddleVo);


    /**
     * 添加图片
     * @param objMoudel
     * @return
     */
    int updatePhoto(@RequestParam(value = "file", required = false) MultipartFile file, ObjMoudel objMoudel);

    /**
     * 拿到楼宇id和计量管理
     * @param
     * @return
     */
    int updateMetering(String id, JSONArray metering);


    boolean addOrUpdateNode(ObjMoudelDTO objMoudelDTO);

    boolean delectNode(List<String> list);


    /**
     * 查图纸
     */
    ObjMoudel selectPhoto(String id);

    /**
     * 查所有楼层所携带的设备 拿出楼层名 和设备deviceId
     * @return
     */
    List<ObjMoudelNameVo> getObjMoudelName();
}
